import React, {Component} from 'react';
import {withRouter} from 'react-router-dom';

class Test extends Component {

  back = () => {
		this.props.history.goBack();
	};

	render() {
		return <div>
      <button onClick={this.back}>回退</button>
    </div>;
	}
}

// withRouter可以加工一般组件,使一般组件可以使用路由组件api
export default withRouter(Test);
